import { defineStore } from 'pinia'
import { ref } from "vue"
export const useTest1Store = defineStore(
    'test1',
    () => {
        let test1Count = ref(0)

        const setText1Count = (num) => {
            test1Count.value = test1Count.value + num
        }
        return {
            test1Count,
            setText1Count
        }
    },
    // TODO: 持久化
    {
        // 网页端的配置
        // persist: true,
        // 小程序端的配置
        persist: {
            storage: {
                getItem: (key) => uni.getStorageSync(key),
                setItem: (key, value) => uni.setStorageSync(key, value)
            },
        },
    },
)